package com.wn.potal.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.*;

/**
 * @author yellow Docter
 * @date 2022 -08-30
 * @desc
 */
@RestController
@RequestMapping("product")
public class ProductController {

    @GetMapping("/{id}")
    @SentinelResource(value="hot",fallback="exceptionHandler")
    public String getProductById(@PathVariable("id") long id){
        return "product:"+id;
    }

    public String exceptionHandler(long id){
        return "热点参数限流";
    }

}
